# 输入:csv文件,csv的每一行都是一个单词或者短语,如果是短语会用'-'隔开
# 输出:两个文件,一个是短语,一个是单词
input_file_name = "60000.csv"
output_words_file_name = "../words.csv"
output_parse_file_name = "../parse.csv"

with open(input_file_name, "r") as input_file:
    with open(output_words_file_name, "w+") as output_words_file:
        with open(output_parse_file_name, "w+") as output_parse_file:
            for line in input_file.readlines():
                if(line != "\n"): #空行
                    line = line.lower()
                    if("'" not in line):
                        if("-" in line):
                            output_parse_file.write(line)
                        else:
                            output_words_file.write(line)
